/*
 * Created by JFormDesigner on Thu Apr 13 09:13:40 CST 2023
 */

package com.canteen.gui.menuinformationform;

import java.awt.*;
import javax.swing.*;

/**
 * @author jf302
 */
public class MenuInformationForm extends JFrame {
    public MenuInformationForm() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        menuIdLabel = new JLabel();
        menuIdInput = new JTextField();
        menuNameLabel = new JLabel();
        menuNameInput = new JTextField();
        menuDateLabel = new JLabel();
        menuDateInput = new JSpinner();
        dishesListLabel = new JLabel();
        menuDetailLabel = new JLabel();
        scrollPane1 = new JScrollPane();
        dishesList = new JList();
        scrollPane2 = new JScrollPane();
        menuDetail = new JList();
        addDishesToMenuButton = new JButton();
        removeDishesFromButton = new JButton();
        dishesSearchInput = new JTextField();
        dishesSearchButton = new JButton();
        menuSaveButton = new JButton();
        menuCancelButton = new JButton();

        //======== this ========
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);
        setTitle("\u83dc\u5355\u751f\u6210");
        var contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- menuIdLabel ----
        menuIdLabel.setText("\u83dc\u5355\u53f7\uff1a");
        contentPane.add(menuIdLabel);
        menuIdLabel.setBounds(new Rectangle(new Point(25, 20), menuIdLabel.getPreferredSize()));
        contentPane.add(menuIdInput);
        menuIdInput.setBounds(80, 20, 135, menuIdInput.getPreferredSize().height);

        //---- menuNameLabel ----
        menuNameLabel.setText("\u83dc\u5355\u540d\uff1a");
        contentPane.add(menuNameLabel);
        menuNameLabel.setBounds(240, 20, 48, 15);
        contentPane.add(menuNameInput);
        menuNameInput.setBounds(295, 20, 135, 21);

        //---- menuDateLabel ----
        menuDateLabel.setText("\u65e5  \u671f\uff1a");
        contentPane.add(menuDateLabel);
        menuDateLabel.setBounds(455, 20, 48, 15);

        //---- menuDateInput ----
        menuDateInput.setModel(new SpinnerDateModel(new java.util.Date((System.currentTimeMillis()/60000)*60000), new java.util.Date((System.currentTimeMillis()/60000)*60000), null, java.util.Calendar.DAY_OF_MONTH));
        contentPane.add(menuDateInput);
        menuDateInput.setBounds(510, 20, 130, menuDateInput.getPreferredSize().height);

        //---- dishesListLabel ----
        dishesListLabel.setText("\u83dc\u54c1\u540d\u79f0\uff1a");
        contentPane.add(dishesListLabel);
        dishesListLabel.setBounds(new Rectangle(new Point(30, 70), dishesListLabel.getPreferredSize()));

        //---- menuDetailLabel ----
        menuDetailLabel.setText("\u83dc\u5355\u5185\u5bb9\uff1a");
        contentPane.add(menuDetailLabel);
        menuDetailLabel.setBounds(380, 70, 60, 15);

        //======== scrollPane1 ========
        {
            scrollPane1.setViewportView(dishesList);
        }
        contentPane.add(scrollPane1);
        scrollPane1.setBounds(45, 100, 205, 250);

        //======== scrollPane2 ========
        {
            scrollPane2.setViewportView(menuDetail);
        }
        contentPane.add(scrollPane2);
        scrollPane2.setBounds(400, 100, 215, 250);

        //---- addDishesToMenuButton ----
        addDishesToMenuButton.setText(">>");
        contentPane.add(addDishesToMenuButton);
        addDishesToMenuButton.setBounds(290, 165, 80, 25);

        //---- removeDishesFromButton ----
        removeDishesFromButton.setText("<<");
        contentPane.add(removeDishesFromButton);
        removeDishesFromButton.setBounds(290, 230, 80, 25);
        contentPane.add(dishesSearchInput);
        dishesSearchInput.setBounds(45, 375, 135, 21);

        //---- dishesSearchButton ----
        dishesSearchButton.setText("\u83dc\u54c1\u540d\u67e5\u627e");
        contentPane.add(dishesSearchButton);
        dishesSearchButton.setBounds(new Rectangle(new Point(195, 375), dishesSearchButton.getPreferredSize()));

        //---- menuSaveButton ----
        menuSaveButton.setText("\u83dc\u5355\u4fdd\u5b58");
        contentPane.add(menuSaveButton);
        menuSaveButton.setBounds(new Rectangle(new Point(415, 375), menuSaveButton.getPreferredSize()));

        //---- menuCancelButton ----
        menuCancelButton.setText("\u53d6\u6d88");
        contentPane.add(menuCancelButton);
        menuCancelButton.setBounds(520, 375, 81, 23);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        setSize(685, 475);
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel menuIdLabel;
    private JTextField menuIdInput;
    private JLabel menuNameLabel;
    private JTextField menuNameInput;
    private JLabel menuDateLabel;
    private JSpinner menuDateInput;
    private JLabel dishesListLabel;
    private JLabel menuDetailLabel;
    private JScrollPane scrollPane1;
    private JList dishesList;
    private JScrollPane scrollPane2;
    private JList menuDetail;
    private JButton addDishesToMenuButton;
    private JButton removeDishesFromButton;
    private JTextField dishesSearchInput;
    private JButton dishesSearchButton;
    private JButton menuSaveButton;
    private JButton menuCancelButton;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
